package com.lvan.fileupload.service;

import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author Lvan
 */
public interface FileService {

    /**
     * 单文件上传
     *
     * @param file file
     * @return String
     */
    String singleFileUpload(MultipartFile file);

    /**
     * 多文件上传
     *
     * @param files file
     * @return List
     */
    List batchFileUpload(MultipartFile[] files);

    /**
     * 文件下载
     *
     * @param fileName 文件名
     * @param response HttpServletResponse
     * @return ResultMsg
     */
    String singleFileDownload(String fileName, HttpServletResponse response);

    /**
     * 多文件打包下载
     *
     * @param fileName 下载文件列表
     * @param response response
     * @return String
     */
    String batchFileDownload(String[] fileName, HttpServletResponse response);
}
